/**
 * 404页面样式
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  min-height: 100vh;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.18);
  border: none;
  outline: none;
  display: flex;
  color: #333;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* 主内容区（适配侧边栏） */
.main-content-404 {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

.container-404 {
  max-width: 600px;
  width: 100%;
  padding: 40px 20px;
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

/* 插图区域 */
.illustration-wrapper {
  margin-bottom: 40px;
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.illustration-image {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  display: block;
  margin: 0 auto;
  animation: float 3s ease-in-out infinite;
}

/* 当图片不存在时的后备样式 */
.illustration-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.illustration-fallback.show {
  display: flex;
}

.number-404 {
  font-size: 120px;
  font-weight: 900;
  color: #2196F3;
  line-height: 1;
  text-shadow: 4px 4px 0px rgba(33, 150, 243, 0.1);
  animation: float 3s ease-in-out infinite;
  letter-spacing: -5px;
}

.icon-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: bounce 2s ease-in-out infinite;
}

.icon-question {
  font-size: 48px;
  color: #FF9800;
  font-weight: bold;
  animation: rotate 4s ease-in-out infinite;
}

/* 错误内容 */
.error-content {
  margin-bottom: 30px;
}

.error-title {
  font-size: 32px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 16px;
  animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.error-message {
  font-size: 16px;
  color: #7f8c8d;
  line-height: 1.6;
  margin-bottom: 30px;
  animation: fadeIn 0.8s ease-out 0.4s backwards;
}

/* 按钮样式 */
.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeIn 0.8s ease-out 0.6s backwards;
}

.btn-primary,
.btn-secondary {
  padding: 12px 32px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  min-width: 140px;
}

.btn-primary {
  background: #2196F3;
  color: white;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
  background: #1976D2;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
  background: white;
  color: #2196F3;
  border: 2px solid #2196F3;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #f5f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 底部提示 */
.footer-hint {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.8s ease-out 0.8s backwards;
}

.footer-hint p {
  font-size: 13px;
  color: #95a5a6;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(15deg);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .main-content-404 {
    padding: 20px 15px;
  }

  .container-404 {
    padding: 30px 15px;
  }

  .number-404 {
    font-size: 80px;
  }

  .error-title {
    font-size: 24px;
  }

  .error-message {
    font-size: 14px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .icon-wrapper {
    width: 60px;
    height: 60px;
  }

  .icon-question {
    font-size: 36px;
  }
}

/* 暗色背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(33, 150, 243, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
  animation: rotate-bg 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate-bg {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
